package seismosurfer.gui.menu;

import javax.swing.JMenu;

import com.bbn.openmap.gui.GoToMenu;

/**
 * An extension to GoToMenu, this menu holds 
 * the submenu which contains various views.
 * A view is represented as a GoToMenu.GoToButton.
 *
 */
public class SeismoGoToMenu extends GoToMenu {
    
    private static final long serialVersionUID = 1923722309251870690L;

    protected JMenu viewsMenu;

    public SeismoGoToMenu() {
        super();
    }
    
    /**
     * Stores the given menu which contains
     * the views (of the map).
     * 
     * @param views the JMenu which contains
     *        the views
     */
    public void setViewsMenu(JMenu views) {
        viewsMenu = views;
    }

    public void addView(GoToButton newOne) {
        viewsMenu.add(newOne);
        revalidate();
    }

}